#include "student.h"

Student::Student(string nm, string no) : name(nm), number(no) 
{
	no_of_courses = 0;
}

string Student::getStudentName()
{
	return name;
}

string Student::getStudentNumber()
{
	return number;
}

void Student::assignGrade(string co, int gr)
{
	if (no_of_courses >= MAXNUM) {
		cout << "You have exceeded the maximum number of courses!" << endl;
		return;
	}
	Course c(co, gr);
	course_grades[no_of_courses++] = c;
}

int Student::getGrade(std::string co) {
	int i = 0;

	while (i < no_of_courses) {
		if (course_grades[i].getCourseName() == co)
			return (course_grades[i].getCourseGrade());
		i++;
	}
	return -1;
}
